package com.sc.admin.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.admin.model.bo.DictBO;
import com.sc.admin.model.entity.sys.SysDict;
import com.sc.admin.model.form.DictForm;
import com.sc.admin.model.vo.DictPageVO;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * 字典数据项对象转换器
 *
 * @author shen chen
 * @since 2022/6/8
 */
@Mapper(componentModel = "spring")
public interface DictConverter {

    Page<DictPageVO> entity2Page(Page<SysDict> page);

    DictForm entity2Form(SysDict entity);
    List<DictBO> toBOList(List<SysDict> entity);

    @InheritInverseConfiguration(name = "entity2Form")
    SysDict form2Entity(DictForm entity);
}
